package info.androidhive.tabsswipe;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

/**
 * Created by Max on 24.06.2014.
 */
public class Tests extends Activity {

	String[] numbers = {"one", "two", "three", "four", "five", "six", "seven"};
	ListView listView;
	ArrayAdapter<String> arrayAdapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.fragment_actions);
		fillListView(getApplicationContext());
	}

	void fillListView(Context context){
		arrayAdapter = new ArrayAdapter<String>(context, R.layout.list_view_row_patern, numbers);
		listView = (ListView) findViewById(R.id.listView);
		listView.setAdapter(arrayAdapter);
		listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> adapterView, View view, int pos, long id) {
//				Toast.makeText(getApplicationContext(),
//						"clicked in item position " + pos + " , ID = " + id + ", " + adapterView.getAdapter().getItem(pos),
//						Toast.LENGTH_SHORT).show();
			}
		});
	}

}
